package org.subside.thread;

/**
 * @Author : zhangbo
 * @data : 2024/5/20
 * @description :
 */
public class test {
    public static void main(String[] args) {
        Thread thread = new Thread();
        Thread[] thread1 = new Thread[10];
        thread.setName("myThread");
        thread.run();
        int num=0;
        //每个任务，10个线程都执行了一次
        for (int i = 0; i < thread1.length; i++) {
            thread1[i] = new Thread(() -> {
                for (int i1 = 0; i1 < 1; i1++) {
                    //打印次数为i1*thread1.length
                    System.out.println("序号:"+i1+"   线程ID,名称："+Thread.currentThread().getId()+"+" + Thread.currentThread().getName());

                }
            }
            );
            thread1[i].start();
        }

    }
}
